gdk/wayland: set requesting surface to xdg-activation
authorJoan Bruguera <joanbrugueram@gmail.com>
Sun, 4 Dec 2022 22:54:51 +0000 (22:54 +0000)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 27 Jan 2023 14:53:41 +0000 (14:53 +0000)
commit41827d9f72cc08eca3907456e1b02ce3c8e55ea2
treed369c8b5406c277afd87a8f8e357d7ced49cbbc8
parentb6795f8ff9548d5defe874a08a520d2611a5d723
gdk/wayland: set requesting surface to xdg-activation

The argument to xdg_activation_token_v1_set_surface is documented to be the
surface requesting the activation, not the surface to be activated, which is
given later when calling xdg_activation_v1_activate.
(c.f. https://gitlab.freedesktop.org/wayland/wayland-protocols/-/commit/36cee4bdbcaf3a75f567315809953b5e21d703da)

Use the same logic as in gdk_wayland_app_launch_context_get_startup_notify_id,
i.e. if we have a surface with focus, set that, otherwise set NULL.

This fixes requesting urgent/focus on wlroots (compositors like Sway, etc.),
which was blocked as the surface requesting the activation didn't have focus.

Backport of: 43c1a433aa0839826451f71029965d8e359a9178

Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
gdk/wayland/gdkwindow-wayland.c